package com.game.modular.game.act.cultivate;

import com.game.comment.core.ResponseResult;
import com.game.comment.util.JwtUtils;
import com.game.modular.game.playerAssets.domain.PlayerSkill;
import com.game.modular.game.playerAssets.service.PlayerSkillServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "玩家战法")
@Validated
@RestController
@AllArgsConstructor
@RequestMapping("/playerSkillAct")
public class PlayerSkillAction {
    private PlayerSkillServiceImpl playerSkillService;

    @ApiOperation("获取所有的战法")
    @PostMapping("/list")
    public ResponseResult<List<PlayerSkill>> list(@RequestHeader String token) {
        return ResponseResult.success(playerSkillService.list(JwtUtils.getPlayerId(token)));
    }
}
